package simpleSolutions.vale.data;

import java.io.Serializable;
import java.util.List;

import org.droidpersistence.dao.DroidDao;
import org.droidpersistence.dao.TableDefinition;


import simpleSolutions.vale.data.util.OpenHelper;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;


public class RepositorioBase<T , I extends Serializable> extends DroidDao<T, I> implements Repositorio<T, I> {

	private Context context;
    private SQLiteDatabase database;
    
    public RepositorioBase(Context context, Class<T> clazz, TableDefinition<T> tableDef)
    {
    	super(clazz, tableDef, (new OpenHelper(context)).getWritableDatabase());
    	this.context = context;
        database = (new OpenHelper(context)).getWritableDatabase();
    	
    }
    
	@Override
	public long save(T item) {
		try {
			return super.save(item);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

	

	@Override
	public List getBy(String nomeDoCampo, Object valor) {
		
		return null;
	}

}
